<?
	include("common.php");

	if(!$loggedin){
		ob_start();
		header("Location: login.php");
	}

	$query = "SELECT * FROM users WHERE uid='$myuid'";
	$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
	if ( ($result) && (mysql_num_rows($result) > 0) ){
		$row = mysql_fetch_object($result);
	}
	include("header.php");
?>
<table cellpadding=0 cellspacing=0 width=90% style="border:1px solid #000000;">
<tr>
	<TD width=80% style="padding-left:10px;padding-right:10px;"><br>
		<table cellpadding=0 cellspacing=0 width=100% style="border:1px solid #000000;">
		<TR>
			<td style="padding-left:10px;border-bottom:1px solid #000000;border-right:1px solid #000000" class=small width=40%><FONT face=arial size=3><B>Username:</B></FONT></TD>
			<td style="padding-left:10px;border-bottom:1px solid #000000;" class=small ><FONT face=arial size=3><?=$row->username?></FONT></TD>
		</TR>
		<TR>
			<td style="padding-left:10px;border-right:1px solid #000000" class=small  width=40%><FONT face=arial size=3><B>Email Address:</B></FONT></TD>
			<td style="padding-left:10px;" class=small ><FONT face=arial size=3><?=$row->email?></FONT></TD>
		</TR>
		</TABLE><BR>
		<br>
	</TD>
	<TD valign=top style="padding-left:10px;padding-right:10px;border-left:1px solid #000000;"><br>
		<TABLE cellPadding=5 width=100% border=0>
		<tr><FORM action=editp.php method=post>
			<td>
				<INPUT style="width:150px;BORDER-RIGHT: #000000 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #a0a0a0 1px solid; PADDING-LEFT: 2px; FONT-WEIGHT: bold; FONT-SIZE: 11px; PADDING-BOTTOM: 2px; BORDER-LEFT: #a0a0a0 1px solid; color:#000000; PADDING-TOP: 2px; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana,Arial; BACKGROUND-COLOR: #e5e5e5; outline: #a0a0a0 solid 2px" type=submit value="Edit Profile">
			</td>
		</tr></form>
		<tr><FORM action=account.php?logout=1 method=post>
			<td>
				<INPUT style="width:150px;BORDER-RIGHT: #000000 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #a0a0a0 1px solid; PADDING-LEFT: 2px; FONT-WEIGHT: bold; FONT-SIZE: 11px; PADDING-BOTTOM: 2px; BORDER-LEFT: #a0a0a0 1px solid; color:#000000; PADDING-TOP: 2px; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana,Arial; BACKGROUND-COLOR: #e5e5e5; outline: #a0a0a0 solid 2px" type=submit value="     Logout    ">
			</td>
		</tr></form>
		</table>
		<br>
	</TD>
</TR>
</TABLE><BR>
<?	if(!$row->forum){	?>
		<table cellpadding=0 cellspacing=0 width=90% style="border:1px solid #000000;">
		<tr>
		<?
			$qr1 = mysql_query("SELECT * FROM forum WHERE uid='$myuid'");
			if( mysql_num_rows($qr1) > 0){
				$forum = mysql_fetch_object($qr1);
		?>
			<TD width=80% style="padding-left:10px;padding-right:10px;"><br>
				<b>My Forum</b><br><br>
				add the following HTML Code into sites where you wish to link to your Forum.
				<p><textarea rows="5" cols="10" style="width:380px;" wrap='PHYSICAL'>
<a href="<?=$siteurl?>/forum.php?forum=<?=$forum->id?>" target="_new">Click Here to View My Forum</a>
				</textarea></p>
				<br>
			<TD valign=top style="padding-left:10px;padding-right:10px;border-left:1px solid #000000;"><br>
				<div class="small">
					<a href="myforum.php">Edit My Forum</a><br>
					<a href="manageforum.php?forum=<?=$forum->id?>">Manage Forum</a>
				</div>
				<br>
			</td>
		<?
			}else{
		?>
			<TD width=80% style="padding-left:10px;padding-right:10px;"><br>
				<b>My Forum</b><br><br>
				<div class="small">
					You have no Forum created yet, <a href="myforum.php">Create a Forum</a>
				</div>
				<br>
			</TD>
		<?
			}
		?>
		</tr>
		</table>
<?	}else{	?>
	<table cellpadding=0 cellspacing=0 width=90% style="border:1px solid #000000;">
	<tr>
	<?
		$qr1 = mysql_query("SELECT * FROM forum WHERE id='".$row->forum."'");
		if( mysql_num_rows($qr1) > 0){
			$forum = mysql_fetch_object($qr1);
?>
			<TD width=80% style="padding-left:10px;padding-right:10px;"><br>
				You are a member of the Forum titled: <?=$forum->name?>.<br>
				<a href="forum.php?forum=<?=$row->forum?>">Click here to view it</a>
				<br><br>
			</td>
<?
		}
	?>
	</tr>
	</table>
<?	}	?>
<Br>
<BR><FONT face=arial size=3>
<?
	include("footer.php");
?>